<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo $base_url; ?>js/Highcharts-2.3.0/js/highcharts.js" type="text/javascript"></script>
<script type="text/javascript">
		$(function () {
			var chart;
			$(document).ready(function() {
				chart = new Highcharts.Chart({
					chart: {
						renderTo: 'chart-container',
						type: 'column',
						zoomType: 'x'
					},
					credits: {
						enabled: false
					},
					title: {
						text: 'Last 30-Days Registrations'
					},
					subtitle: {
						text: '<?=date('D, m/d/Y',$reports['span']['from']).'-'.date('D, m/d/Y',$reports['span']['to'])?>'
					},
					xAxis: {
						categories: [
							<?php
									for($i=0;$i<31;$i++)
									{
											echo "\n\t\t\t\t\t\t\t'".date("m/d/Y", $reports['span']['from']+$i*24*60*60)."',";
											// echo "\n\t\t\t\t\t\t\t'".(date("d", $reports['span']['from']+$i*24*60*60))."',";
									}
							?>
						],
						labels: {
							staggerLines: 2
						}
					},
					yAxis: {
						min: 0,
						title: {
							text: 'Signups (new accounts)'
						}
					},
					legend: {
						layout: 'vertical',
						backgroundColor: '#FFFFFF',
						align: 'left',
						verticalAlign: 'top',
						x: 100,
						y: 70,
						floating: true,
						shadow: true
					},
					tooltip: {
						formatter: function() {
							return ''+
								this.x +': '+ this.y +' users';
						}
					},
					plotOptions: {
						column: {	
							pointStart: 1,
							pointWidth: 10,
							pointPadding: 0.2,
							borderWidth: 0
						}
					},
					series: [{
						name: 'All',
						data: [<?php
									$cnt = 0;
									foreach($reports['registrations']['aggregated'] as $stat)
									{
											echo ($cnt>0?", ":'') . $stat;
											$cnt++;
									}
							?>]
			
					}, {
						name: 'Demo',
						data: [<?php
									$cnt = 0;
									foreach($reports['registrations']['demo'] as $stat)
									{
											echo ($cnt>0?", ":'') . $stat;
											$cnt++;
									}
							?>]
			
					}, {
						name: 'Live',
						data: [<?php
									$cnt = 0;
									foreach($reports['registrations']['live'] as $stat)
									{
											echo ($cnt>0?", ":'') . $stat;
											$cnt++;
									}
							?>]
			
					}, {
						name: 'Partner',
						data: [<?php
									$cnt = 0;
									foreach($reports['registrations']['partner'] as $stat)
									{
											echo ($cnt>0?", ":'') . $stat;
											$cnt++;
									}
							?>]
			
					}]
				});
			});
			
		});
</script>